﻿/**
 * ...
 * @author sminutoli
 */

import com.dmotiko.general.*
import com.dmotiko.prune.*
import mx.transitions.easing.Regular;
import mx.transitions.Tween;
 
class ShadowClip extends BaseClip
{
	
	private var mcRect:MovieClip;
	
	private function initClip():Void {
		bShowed = false;
		_visible = false;
		_alpha = 0;
		useHandCursor = false;
		
		mcRect._width = Stage.width *2;
		mcRect._height = Stage.height * 2;
		mcRect._x = - mcRect._width / 4;
		mcRect._y = - mcRect._height / 4;
	}
		
	public function onRollOver() {
		//solo hago esto para bloquear a los contenidos de abajo
	}
	
	public function show() {
		_visible = true;
		registerTween("fade", new Tween( this, "_alpha", Regular.easeOut, 0, 100, 0.5, true), false, true);
	}
	public function hide() {
		registerTween("fade", new Tween( this, "_alpha", Regular.easeOut, this._alpha, 0, 0.5, true), false, true);
	}
	
	private function tweenFinished( key:String, tween:Tween):Void {
		switch ( key ){
			case "fade":
			if ( this._alpha == 0 ) {
				_visible = false;
				hideEnd();
			} else {
				showEnd();
			}
			break;
		}
	}
	
}